package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.order.domain.SyCourseOrders;
import com.ruoyi.order.mapper.SyCourseOrdersMapper;
import com.ruoyi.order.service.ISyCourseOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 课程订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-19
 */
@Service
public class SyCourseOrdersServiceImpl implements ISyCourseOrdersService
{
    @Autowired
    private SyCourseOrdersMapper syCourseOrdersMapper;

    /**
     * 查询课程订单
     * 
     * @param orderId 课程订单主键
     * @return 课程订单
     */
    @Override
    public SyCourseOrders selectSyCourseOrdersByOrderId(String orderId)
    {
        return syCourseOrdersMapper.selectSyCourseOrdersByOrderId(orderId);
    }

    /**
     * 查询课程订单列表
     * 
     * @param syCourseOrders 课程订单
     * @return 课程订单
     */
    @Override
    public List<SyCourseOrders> selectSyCourseOrdersList(SyCourseOrders syCourseOrders)
    {
        return syCourseOrdersMapper.selectSyCourseOrdersList(syCourseOrders);
    }

    /**
     * 新增课程订单
     * 
     * @param syCourseOrders 课程订单
     * @return 结果
     */
    @Override
    public int insertSyCourseOrders(SyCourseOrders syCourseOrders)
    {
        syCourseOrders.setCreateTime(DateUtils.getNowDate());
        return syCourseOrdersMapper.insertSyCourseOrders(syCourseOrders);
    }

    /**
     * 修改课程订单
     * 
     * @param syCourseOrders 课程订单
     * @return 结果
     */
    @Override
    public int updateSyCourseOrders(SyCourseOrders syCourseOrders)
    {
        syCourseOrders.setUpdateTime(DateUtils.getNowDate());
        return syCourseOrdersMapper.updateSyCourseOrders(syCourseOrders);
    }

    /**
     * 批量删除课程订单
     * 
     * @param orderIds 需要删除的课程订单主键
     * @return 结果
     */
    @Override
    public int deleteSyCourseOrdersByOrderIds(String[] orderIds)
    {
        return syCourseOrdersMapper.deleteSyCourseOrdersByOrderIds(orderIds);
    }

    /**
     * 删除课程订单信息
     * 
     * @param orderId 课程订单主键
     * @return 结果
     */
    @Override
    public int deleteSyCourseOrdersByOrderId(String orderId)
    {
        return syCourseOrdersMapper.deleteSyCourseOrdersByOrderId(orderId);
    }

    @Override
    public SyCourseOrders selectSyCourseOrdersUsersByOrderId(String orderId) {
        return syCourseOrdersMapper.selectSyCourseOrdersUsersByOrderId(orderId);
    }

    @Override
    public int courseOrdersAll() {

        return syCourseOrdersMapper.courseOrdersAll();
    }
}
